<!DOCTYPE html>
<html>
<head>
    <meta name="Generator" content="ECSHOP v2.7.3">
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta charset="utf-8">
    <title>美尚良品-商品详情</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" type="text/css" href="css/base2013.css" charset="gbk">
    <link rel="stylesheet" type="text/css" href="css/all_html5.css" charset="gbk">
    <link href="css/ectouch.css" rel="stylesheet" type="text/css">

    <script src="js/lxb.js" async="" charset="utf-8" type="text/javascript"></script>
    <script type="text/javascript"  src="js/transport.js"></script>
    <script type="text/javascript"  src="js/jquery-1.6.2.min.js"></script>
    <script type="text/javascript"  src="js/jquery.json-1.3.js"></script>
    <script type="text/javascript"  src="js/common_pc.js"></script>
    <script type="text/javascript"  src="js/common.js"></script>
    <script type="text/javascript">
        // 筛选商品属性
        jQuery(function ($) {
            $(".info").click(function () {
                $('.goodsBuy .fields').slideToggle("fast");
            });
        })
        function changenum(diff) {
            var num = parseInt(document.getElementById('goods_number').value);

            var goods_number = num + Number(diff);
            $("#cartNum ").text(goods_number);
            if (goods_number >= 1) {
                document.getElementById('goods_number').value = goods_number;//更新数量
               // document.getElementById('cartNum ').innerHTML = goods_number;
                changePrice();
            }
        }
    </script>

    <link charset="utf-8" type="text/css"  href="css/1001.css"  rel="stylesheet">

</head>

<body style="cursor: auto;" ryt14337="1">
    <a name="top"></a>
    <header>
        <div class="new-header" id="header">
            <div class="header_l">
                <a href="javascript:pageBack();" class="ico_10">返回</a>
            </div>
            <h2>商品详情 </h2>
            <a href="javascript:void(0)" id="btnJdkey" class="new-a-jd"><span>美尚键</span></a>
        </div>

        <div class="new-jd-tab" style="display:none" id="jdkey">
            <div class="new-tbl-type">
                <a href="index.php" class="new-tbl-cell">
                    <span class="icon">首页</span>
                    <p style="color:#6e6e6e;">首页</p>
                </a>
                <a href="cat_all.php" class="new-tbl-cell">
                    <span class="icon2 on">分类搜索</span>
                    <p class="on" style="color:#6e6e6e;">分类搜索</p>
                </a>
                <a href="flow.php" id="html5_cart" class="new-tbl-cell">
                    <span class="icon3">购物车</span>
                    <p style="color:#6e6e6e;">购物车</p>
                </a>
                <a href="user.php" class="new-tbl-cell">
                    <span class="icon4">我的美尚</span>
                    <p style="color:#6e6e6e;">我的美尚</p>
                </a>
            </div>
        </div>
    </header>

    <section class="goods_slider">
        <div class="blank2"></div>
        <div id="slideBox" class="slideBox">
            <div class="scroller">
                <div class="tempWrap" style="overflow:hidden; position:relative;">
                    <ul style="width: 1536px; position: relative; overflow: hidden; padding: 0px; margin: 0px; transition-duration: 0ms; transform: translateX(-512px);">
                        <li style="margin:0 auto; vertical-align: top; width: 512px;">
                            <a href="javascript:showPic()"><img alt="" src='../../{$goods_info.goods_thumb}'></a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="icons">
                <ul>
                    <li class="on">1</li>
                </ul>
            </div>
        </div>
        <div class="blank2"></div>
    </section>

    <script type="text/javascript">
        TouchSlide({
            slideCell: "#slideBox",
            titCell: ".icons ul", //开启自动分页 autoPage:true ，此时设置 titCell 为导航元素包裹层
            mainCell: ".scroller ul",
            effect: "leftLoop",
            autoPage: true,//自动分页
            autoPlay: false //自动播放
        });
        function showPic() {
            var data = document.getElementById("slideBox").className;
            var reCat = /ui-gallery/;

            if (reCat.test(data)) {
                document.getElementById("slideBox").className = 'slideBox';
            } else {
                document.getElementById("slideBox").className = 'slideBox ui-gallery';
            }
        }
    </script>

    <form action="javascript:addToCart({$goods_info.goods_id})" method="post" name="ECS_FORMBUY" id="ECS_FORMBUY">
        <section class="goodsInfo">
            <a class="collect" id="collect_box" href="javascript:collect({$goods_info.goods_id})" style="display: inline;"></a>
            <div class="title">
                <h1> {$goods_info.goods_name} </h1>
            </div>
            <ul>
                <li>本店售价：<b class="price" id="shop_price">{$goods_info.shop_price}</b></li>
                <li> 市场价格：
                    <del>{$goods_info.market_price}</del>
                </li>
            </ul>

            <ul>
                <li>月销量：{$goods_info.sell_count}件</li>
            </ul>

            <!-- {* 开始循环所有可选属性 *} -->
            <!-- {foreach from=$specification item=spec key=spec_key} -->
            <ul>
                <li>
                {$spec.name}:
                <!-- {* 判断属性是复选还是单选 *} -->
                <!-- {if $spec.attr_type eq 1} -->
                <!-- {if $cfg.goodsattr_style eq 1} -->
                <!-- {foreach from=$spec.values item=value key=key} -->
                <label for="spec_value_{$value.id}">
                    <input type="radio" name="spec_{$spec_key}" value="{$value.id}" id="spec_value_{$value.id}" {if $key eq 0}checked{/if} onclick="changePrice()" />
                    {$value.label}  </label><br />
                <!-- {/foreach} -->
                <input type="hidden" name="spec_list" value="{$key}" />
                </li>
                <!-- {else} -->
                <select name="spec_{$spec_key}" onchange="changePrice()">
                    <!-- {foreach from=$spec.values item=value key=key} -->
                    <option label="{$value.label}" value="{$value.id}">{$value.label} {if $value.price gt 0}{$lang.plus}{elseif $value.price lt 0}{$lang.minus}{/if}{if $value.price neq 0}{$value.format_price}{/if}</option>
                    <!-- {/foreach} -->
                </select>
                <input type="hidden" name="spec_list" value="{$key}" />
                </li>
                <!-- {/if} -->
                <!--{elseif $spec.attr_type eq 3}-->
                <!-- {foreach from=$spec.values item=value key=key} -->
                <label for="spec_value_{$value.id}">
                    <input type='text' name="spec_" id="{$value.id}"  onclick="changePrice()"/>{$value.label}
                </label>
                <!-- {/foreach} -->
                <input type="hidden" name="spec_list" value="{$key}" />
                </li>
                <!-- {else} -->
                <!-- {foreach from=$spec.values item=value key=key} -->
                <label for="spec_value_{$value.id}">
                    <input type="checkbox" name="spec_{$spec_key}" value="{$value.id}" id="spec_value_{$value.id}" onclick="changePrice()" />
                    {$value.label}
                </label><br/>
                <!-- {/foreach} -->
                <input type="hidden" name="spec_list" value="{$key}" />
                </li>
                <!-- {/if} -->
            </ul>
            <!-- {/foreach} -->
            <!-- {* 结束循环可选属性 *} -->

        </section>
        <div class="wrap">
            <section class="goodsBuy radius5">
                <input id="goodsBuy-open" type="checkbox">
                <label class="info" for="goodsBuy-open">
                    <div>请选择<span></span><i></i></div>
                    <div class="selected"></div>
                </label>


                    <div class="fields" style="display:block;">
                        <ul class="ul1">
                            <li>商品总价：<font id="ECS_GOODS_AMOUNT" class="price">{$goods_info.shop_price}</font></li>
                        </ul>
                        <ul class="ul2">


                        </ul>
                        <ul class="quantity">
                            <h2>数量：</h2>

                            <div class="items">
                                <span class="ui-number radius5">
                                <button type="button" class="decrease radius5" onclick="changenum(- 1)">-</button>
                                <input class="num" name="number" id="goods_number" autocomplete="off" value="1" min="1" max=""  type="number" onblur="changePrice()">
                                <button type="button" class="increase radius5" onclick="changenum(1)">+</button>
                                <input type="hidden" value="{$goods_info.extension_code}" name="extension_code">
                                </span>
                            </div>
                        </ul>
                    </div>
                    <div class="option">

                        <script type="text/javascript">
                            function addToCart_quick(goodsId, parentId)
                            {
                                //alert(1);
                                var goods        = new Object();
                                var spec_arr     = new Array();
                                var fittings_arr = new Array();
                                var number       = 1;
                                var formBuy      = document.forms['ECS_FORMBUY'];
                                var quick		   = 0;

                                // 检查是否有商品规格
                                if (formBuy)
                                {
                                    spec_arr = getSelectedAttributes(formBuy);

                                    if (formBuy.elements['number'])
                                    {
                                        number = formBuy.elements['number'].value;
                                    }

                                    quick = 1;
                                }

                                goods.quick    = quick;
                                goods.spec     = spec_arr;
                                goods.goods_id = goodsId;
                                goods.number   = number;
                                goods.parent   = (typeof(parentId) == "undefined") ? 0 : parseInt(parentId);

                                Ajax.call('flow.php?step=add_to_cart', 'goods=' + goods.toJSONString(), addToCartResponse_quick, 'POST', 'JSON');
                            }

                            function showDiv() {
                                document.getElementById('popDiv').style.display = 'block';
                                document.getElementById('hidDiv').style.display = 'block';
                                document.getElementById('showDiv').innerHTML = document.getElementById('goods_number').value;
                                document.getElementById('cartPrice').innerHTML = document.getElementById('ECS_GOODS_AMOUNT').innerHTML;
                            }
                            function closeDiv() {
                                document.getElementById('popDiv').style.display = 'none';
                                document.getElementById('hidDiv').style.display = 'none';
                            }

                        </script>
                        <button type="button" class="btn buy radius5" onclick = "addToCart({$goods_info.goods_id})">立即购买</button>
                        <button type="button" class="btn cart radius5" onclick="showDiv()">
                            <div class="ico_01"></div>
                            加入购物车
                        </button>

                        <div class="tipMask" id="hidDiv" style="display:none"></div>
                        <div class="popGeneral" id="popDiv">
                            <div class="tit">
                                <h4>商品加入购物车</h4>
                                <span class="ico_08" onclick="closeDiv()"><a href="javascript:"></a></span></div>
                            <div id="main">
                                <div id="left"><img
                                        src="../../{$goods_info.goods_thumb}"
                                        height="115" width="115"></div>
                                <div id="right">
                                    <p>{$goods_info.goods_name}</p>
                                    <span> 加入数量： <b id="cartNum"></b></span> <span> 总计金额： <b id="cartPrice"></b></span>
                                </div>
                            </div>
                            <div class="popbtn"><a class="bnt1 flex_in radius5" onclick="closeDiv()" href="javascript:void(0);">继续购物</a>
                                <a class="bnt2 flex_in radius5"  onclick="addToCart({$goods_info.goods_id})">去结算</a></div>
                        </div>

                    </div>
            </section>
        </div>
    </form>

    <script type="text/javascript">
        //介绍 评价 咨询切换
        var tab_now = 1;
        function tab(id) {
            document.getElementById('tabs' + tab_now).className = document.getElementById('tabs' + tab_now).className.replace('current', '');
            document.getElementById('tabs' + id).className = document.getElementById('tabs' + id).className.replace('', 'current');
            tab_now = id;
            if (id == 1) {
                document.getElementById('tab1').className = '';
                document.getElementById('tab2').className = 'hidden';
                document.getElementById('tab3').className = 'hidden';
            } else if (id == 2) {
                document.getElementById('tab1').className = 'hidden';
                document.getElementById('tab2').className = '';
                document.getElementById('tab3').className = 'hidden';
            } else if (id == 3) {
                document.getElementById('tab1').className = 'hidden';
                document.getElementById('tab2').className = 'hidden';
                document.getElementById('tab3').className = '';
            }
        }
    </script>
    <section class="s-detail">
    <header>
        <ul style="position: static;" id="detail_nav">
            <li id="tabs1" onclick="tab(1)" class="current"> 详情</li>
            <li id="tabs2" onclick="tab(2)" class=""> 评价 <span class="review-count">({$comments_num})</span></li>
            <li id="tabs3" onclick="tab(3)" class=""> 热销</li>
        </ul>
    </header>
    <div id="tab1" class="">
        <div class="desc wrap">
            <div class="blank2"></div>
            <div style="text-align: center;height:auto" class="tit1">{$goods_info.goods_desc}</div>

            <div class="tit2">&nbsp;</div>
            <p style="text-align: center;"><img
                    src=""
                    alt=""></p></div>
    </div>
    <div id="tab2" class="hidden">
        <div class="wrap">
            <div class="blank2"></div>
            <script type="text/javascript"
                    src="js/transport.js"></script>
            <script type="text/javascript"
                    src="js/utils.js"></script>
            <div id="ECS_COMMENT">
                <ul class="list">
                    {foreach from=$comments_info.comments item=val}
                    <li class="radius5">
                        <div class="tit radius5"><span>{$val.username}</span>{$val.add_time}</div>
                        <p>评分：<img
                                src="../../mobile/images/stars{$val.rank}.gif"
                                class="star" alt=""></p>

                        <p>评论：{$val.content}</p>
                    </li>
                    {/foreach}
                </ul>
            <div class="blank2"></div>

            <script type="text/javascript">
                //<![CDATA[
                var cmt_empty_username = "请输入您的用户名称";
                var cmt_empty_email = "请输入您的电子邮件地址";
                var cmt_error_email = "电子邮件地址格式不正确";
                var cmt_empty_content = "您没有输入评论的内容";
                var captcha_not_null = "验证码不能为空!";
                var cmt_invalid_comments = "无效的评论内容!";

                /**
                 * 提交评论信息
                 */
                function submitComment(frm) {
                    var cmt = new Object;

                    //cmt.username        = frm.elements['username'].value;
                    cmt.email = frm.elements['email'].value;
                    cmt.content = frm.elements['content'].value;
                    cmt.type = frm.elements['cmt_type'].value;
                    cmt.id = frm.elements['id'].value;
                    cmt.enabled_captcha = frm.elements['enabled_captcha'] ? frm.elements['enabled_captcha'].value : '0';
                    cmt.captcha = frm.elements['captcha'] ? frm.elements['captcha'].value : '';
                    cmt.rank = 0;

                    for (i = 0; i < frm.elements['comment_rank'].length; i++) {
                        if (frm.elements['comment_rank'][i].checked) {
                            cmt.rank = frm.elements['comment_rank'][i].value;
                        }
                    }

                    if (cmt.email.length > 0) {
                        if (!(Utils.isEmail(cmt.email))) {
                            alert(cmt_error_email);
                            return false;
                        }
                    }
                    else {
                        alert(cmt_empty_email);
                        return false;
                    }

                    if (cmt.content.length == 0) {
                        alert(cmt_empty_content);
                        return false;
                    }

                    if (cmt.enabled_captcha > 0 && cmt.captcha.length == 0) {
                        alert(captcha_not_null);
                        return false;
                    }

                    Ajax.call('comment.php', 'cmt=' + $.toJSON(cmt), commentResponse, 'POST', 'JSON');
                    return false;
                }

                /**
                 * 处理提交评论的反馈信息
                 */
                function commentResponse(result) {
                    if (result.message) {
                        alert(result.message);
                    }

                    if (result.error == 0) {
                        var layer = document.getElementById('ECS_COMMENT');

                        if (layer) {
                            layer.innerHTML = result.content;
                        }
                    }
                }
                </script>
            </div>
        </div>
    </div>
    <div id="tab3" class="hidden">
        <div class="wrap">
            <ul class="m-recommend ">
                <div class="blank2"></div>
                {foreach from=$hot_sale item=val}
                        <li class="flex_in  ">
                        <a href="{$val.0.url}">
                            <div class="summary radius5">
                                <img  src="../../{$val.0.thumb}"  alt="">
                                <div class="price">
                                    {$val.0.shop_price}
                                </div>
                            </div>
                        </a>
                        </li>
                        <li class="flex_in  " style="float:right"><a href="{$val.1.url}">
                            <div class="summary radius5"><img
                                    src="../../{$val.1.thumb}" alt="">
                                <div class="price">
                                    {$val.1.shop_price}
                                </div>
                            </div>
                        </a>
                        </li>
                {/foreach}
            </ul>
        </div>
    </div>
    </section>

    <!--尾部 start-->
    <div style="width: 10px;height: 10px"></div>
    <style>

        .login-area {
            padding-bottom: 1.8em;
            text-align: center;
            width: 100%;
            max-width: 640px;
            background-color: #fff;
            margin: 0 auto
        }

        .login-area a {
            color: #666
        }

        .login-area .lg-bar {
            display: inline-block;
            margin: 0 2px;
            color: #666
        }

        .login-area .login {
            padding: 1.55em 1.71em;
            border-bottom: 0px solid #e5e5e5;
            text-align: left
        }

        .new-fl {
            float: left
        }

        .new-fr {
            float: right
        }

        .version {
            padding: .71em 0 5px
        }

        .version a {
            padding: 0 1.16em;
            color: #6e6e6e
        }

        .version a.on {
            color: #e6242b
        }
        .copyright {
            font-size: 12px;
            color: #666
        }
    </style>

    <div class="login-area" id="footer" style="background: none repeat scroll 0 0 #fff;padding-top:0;padding-bottom:0;">
        <div style="width:100%;margin-bottom: 5px" class="d_center">
            <div class="login" >
                <span class="new-fl">
                    {if $user_name neq null}
                    <a>{$user_name}</a><span class="lg-bar">|</span><a href="user.php?act=logout">退出</a>
                    {else}
                    <a href="user.php">登录</a><span class="lg-bar">|</span><a href="user.php?act=register">注册</a>
                    {/if}
                </span>
                <span class="new-fr"><a href="user.php?act=message_list">反馈</a><span class="lg-bar">|</span><a href="#top">回到顶部</a></span>
            </div>
        </div>
        <div class="version" id="clientArea">
            <a href="javascript:void(0)" class="on">触屏版</a>
            <a href="index.php?computer=1" id="toPcHome">电脑版</a>
        </div>
        <div class="copyright">©mp.p.com</div>
    </div>

<link href="css/global_nav.css" type="text/css" rel="stylesheet">

<script type="text/javascript"
        src="js/zepto.js"></script>

<script src="js/h.js"
        type="text/javascript"></script>


<script type="text/javascript">
    var goods_id = {$goods_id};
    var goodsattr_style = 1;
    var gmt_end_time = 0;
    var day = "天";
    var hour = "小时";
    var minute = "分钟";
    var second = "秒";
    var end = "结束";
    var goodsId = {$goods_id};
    var now_time = 1406854992;
    onload = function () {
        changePrice();
        fixpng();
        try {
            onload_leftTime();
        }
        catch (e) {
        }
    }
    /**
     * 点选可选属性或改变数量时修改商品价格的函数
     */
    function changePrice() {
        var attr = getSelectedAttributes(document.forms['ECS_FORMBUY']);
        //alert(attr);
        var qty = document.forms['ECS_FORMBUY'].elements['number'].value;
        $("#cartNum ").text(qty);
        //alert(qty);
        Ajax.call('goods.php', 'act=price&id=' + goodsId + '&attr=' + attr + '&number=' + qty, changePriceResponse, 'GET', 'JSON');
    }
    /**
     * 接收返回的信息
     */
    function changePriceResponse(res) {
        if (res.err_msg.length > 0) {
            alert(res.err_msg);
        }
        else {
            document.forms['ECS_FORMBUY'].elements['number'].value = res.qty;
            //alert(res.result);
            if (document.getElementById('ECS_GOODS_AMOUNT'))
                document.getElementById('ECS_GOODS_AMOUNT').innerHTML = res.result;
                $("#cartPrice").text(res.result);
        }
    }
</script>

</body>
</html>